home *** CD-ROM | disk | FTP | other *** search
Wrap
unit LeastSquares; {This is a stub version of the least squares curve fitting module required to compile the Image program.} {When you compile with this version you will get a beep when you try to use the Calibrate command.} {If you really need to calibrate to density standards you will need to purchase the Turbo Pascal Numerical Methods} {Toolbox for the Macintosh(which is supplied in source form), or to write you own least squares fitting routine. } {If you do decide to write you own routine, and are willing to make it public, please let me know.} {When compiling the module from the Numerical Methods package with Lightspeed Pascal, you will} {need to make some changes, shown below, in the three places where the nonstandard FillChar routine is used.} {FillChar(OldConversionVec, SizeOf(OldConversionVec), 0);} {for i := 1 to TnRowSize do OldConversionVec[i] := 0.0;} {FillChar(Solution, SizeOf(Solution), 0);} {for i := 1 to TNRowSize do Solution[i] := 0.0;} {FillChar(Basis[Index]^, SizeOf(Basis[Index]^), 0);} {for i := 1 to TNRowSize d Basis[index]^[i] := 0.0;} {You may also need to remove some of the comments before LSP will accept the entire file.} interface const TNRowSize = 20; TNColumnSize = 300; type TNColumnVector = array[1..TNColumnSize] of Extended; TNRowVector = array[1..TNRowSize] of Extended; TNmatrix = array[1..TNColumnSize] of ^TNRowVector; TNSquareMatrix = array[1..TNRowSize] of TNRowVector; TNString40 = string[40]; FitType = (Expo, Fourier, Log, Poly, Power, User); procedure LeastSquares (NumPoints: integer; var XData: TNColumnVector; var YData: TNColumnVector; NumTerms: integer; var Solution: TNRowVector; var YFit: TNColumnVector; var Residuals: TNColumnVector; var StandardDeviation: Extended; var Variance: Extended; var Error: byte; Fit: FitType); implementation procedure LeastSquares; begin error := 111; end; end. { LeastSquares }